package com.compound;

public class DuckSimulator2 {

	public static void main(String[] args) {
		DuckSimulator2 simulator2 = new DuckSimulator2();
		simulator2.simulate();
	}

	void simulate() {
		Quackable mallardDuck = new MallardDuck();
		Quackable redheadDuck = new RedheadDuck();
		Quackable duckCall = new DuckCall();
		Quackable rubberDuck = new RubberDuck();

		// Goose Adapter
		// Take the goose as a duck
		Quackable gooseDuck = new GooseAdapter(new Goose());

		System.out.println("\nDuck Simulator");

		simulate(mallardDuck);
		simulate(redheadDuck);
		simulate(duckCall);
		simulate(rubberDuck);
		simulate(gooseDuck);
	}

	void simulate(Quackable duck) {
		duck.quack();
	}

}
